# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php83-pecl-ev
_extname=ev
pkgver=1.2.0
pkgrel=0
pkgdesc="PHP 8.3 extension provides interface to libev library - PECL"
url="https://pecl.php.net/package/ev"
arch="all"
license="PHP-3.01"
_phpv=83
_php=php$_phpv
depends="$_php-sockets $_php-pcntl $_php-posix"
makedepends="$_php-dev libev-dev"
source="php-pecl-$_extname-$pkgver.tar.gz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=/usr/bin/php-config$_phpv
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test PHP_TEST_SHARED_EXTENSIONS=" \
	-d extension=/usr/lib/$_php/modules/pcntl.so \
	-d extension=/usr/lib/$_php/modules/posix.so \
	-d extension=/usr/lib/$_php/modules/sockets.so \
	-d extension=modules/$_extname.so" TESTS=--show-diff
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
018deff6306f4894c54cce03266e0fdb9ee04f45def4cfeb628c96332f768adc7a6ccc17987f6e7b5fac9874e66594962d9f0ee11022e9f9de53015513ab8e4a  php-pecl-ev-1.2.0.tar.gz
"
